<script setup >
import { defineProps } from "vue";
const props = defineProps({
	XXHWList:Array
  })
</script>

<template>
  <view class="panel fresh">
    <view class="title">
      新鲜好物
      <navigator
        hover-class="none"
        class="more"
        url="/pages/recommend/index?type=5"
        >更多</navigator
      >
    </view>
    <view class="cards">
      <navigator
        hover-class="none"
        :url="`/pages/goods/index?id=${item.id}`"
        v-for="item in XXHWList"
        :key="item.id"
      >
        <image mode="aspectFit" :src="item.picture"></image>
        <view class="name">{{ item.name }}</view>
        <view class="price">
          <text class="small">¥</text>{{ item.price }}
        </view>
      </navigator>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.content {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
  overflow: hidden;
  background-color: #f7f7f8;
}
/* 公共面板 */
.panel {
  margin: 20rpx 20rpx 0;
  border-radius: 10rpx;
  background-color: #fff;
  .title {
    display: flex;
    align-items: center;
    padding: 24rpx 24rpx 0;
    font-size: 32rpx;
    color: #262626;
    position: relative;
    text {
      font-size: 24rpx;
      color: #7f7f7f;
      margin-left: 18rpx;
    }
  }
  .more {
    position: absolute;
    right: 24rpx;
    font-size: 26rpx;
    color: #7f7f7f;
  }
  .cards {
    display: flex;
  }
  .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 新鲜好物 */
.fresh {
  min-height: 320rpx;
  .price {
    line-height: 1;
    text-align: left;
    font-size: 26rpx;
    color: #cf4444;
  }
  .small {
    font-size: 80%;
  }
}
.fresh .cards navigator,
.brands .cards navigator {
  width: 25%;
  padding: 15rpx 20rpx 20rpx;
  line-height: 1;
  text-align: center;
}
.fresh image,
.brands image {
  width: 126rpx;
  height: 126rpx;
}
.fresh .name,
.brands .name {
  margin: 20rpx 0 16rpx;
  font-size: 24rpx;
  color: #262626;
}
.brands {
  .price {
    font-size: 24rpx;
    color: #999;
  }
}
</style>

